using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using WEB.BLL.Entities;
using WEB.Exceptions;
namespace WEB.BLL.Services
{
	#region CvService

	/// <summary>
	/// DesktopService object for Ibatis mapped table 'Desktop'.
	/// </summary>
	public class CvService : ICvService
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(CvService).Name);
	  	private static volatile CvService _CvService = null;
        public static CvService GetInstance()
        {
            if (_CvService == null)
            {
                lock (typeof( CvService))
                {
                    if (_CvService == null) // double-check
                        _CvService = new CvService();
                }
            }
            return _CvService;
        }
		public CvService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public IList<CvEntity> Find(CvEntity obj)
        {
            try
            {
                IList<CvEntity> resul = ExecuteQueryForList<CvEntity>("CvSearch", obj);
                return resul;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        public CvEntity LoadPrimaryKeyEX(CvEntity objE)
        {
            try
            {
                return ExecuteQueryForObject<CvEntity>("CvLoadPrimaryKeyEX", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
    }
    #endregion
}
